﻿using Magicodes.ExporterAndImporter.Core;
using Newtonsoft.Json.Linq;
using NP.BPMReportPlatform.Entities.BPM_Business;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;
using static NP.BPMReportPlatform.RecurringJobs.Dto.SFPerformDto.SFFormTitleResponse;

namespace NP.BPMReportPlatform.Performance.Dto
{
    /// <summary>
    /// 员工绩效Dto
    /// </summary>
    public class PerformanceDto
    {
        public class GetPerformanceResultOutput : PerformanceEntity
        {
            /// <summary>
            /// 是否可以打分
            /// </summary>
            public bool IsCanScope { get; set; }

            /// <summary>
            /// 是否可以催办
            /// </summary>
            public bool IsCanUrging { get; set; }
        }

        public class GetPerformanceResultInput : PagedAndSortedRequestDto
        {
            /// <summary>
            /// 关键字检索
            /// </summary>
            public string KeyWord { get; set; }

            public string KeyWord2 { get; set; }

            public string FormTitle { get; set; }
            public string TodoEntryName { get; set; }

            public int? Status { get; set; }

            public int? CategoryId { get; set; }
        }

        public class SubmitScopeDto
        {
            /// <summary>
            /// 待办id
            /// </summary>
            public int ToDoEntryId { get; set; }
            /// <summary>
            /// -1：上一步，1：下一步 0：暂存 4：员工确认
            /// </summary>
            public int Status { get; set; }

            public List<ScopeDto> Scopes { get; set; }

            /// <summary>
            /// 退回原因
            /// </summary>
            public string Record1 { get; set; }
        }

        public class ScopeDto
        {
            /// <summary>
            /// 结果
            /// </summary>
            public string scope { get; set; }

            /// <summary>
            /// 关键key
            /// </summary>
            public string scopeKey { get; set; }
        }

        /// <summary>
        /// 导出
        /// </summary>
        public class ExportPerformanceOutput
        {
            /// <summary>
            /// 待办主键
            /// </summary>
            [ExporterHeader("待办主键")]
            public int TodoEntryId { get; set; }

            /// <summary>
            /// 表单ID
            /// </summary>
            [ExporterHeader("表单ID")]
            public string FormDataId { get; set; }

            /// <summary>
            /// 表单标题
            /// </summary>
            [ExporterHeader("表单标题")]
            public string FormTitle { get; set; }

            /// <summary>
            /// 审批步骤
            /// </summary>
            [ExporterHeader("审批步骤")]
            public string TodoEntryName { get; set; }

            /// <summary>
            /// 审批人工号
            /// </summary>
            [ExporterHeader("审批人工号")]
            public string WorkNumber { get; set; }

            /// <summary>
            /// 审批人工号
            /// </summary>
            [ExporterHeader("审批人姓名")]
            public string UserName { get; set; }

            /// <summary>
            /// 考核人工号
            /// </summary>
            [ExporterHeader("考核人工号")]
            public string SubjectId { get; set; }

            /// <summary>
            /// 考核人姓名
            /// </summary>
            [ExporterHeader("考核人姓名")]
            public string SubjectName { get; set; }

            /// <summary>
            /// 最后更新时间
            /// </summary>
            [ExporterHeader("最后更新时间")]
            public DateTime? LastModifiedDateTime { get; set; }

            /// <summary>
            /// 待办链接
            /// </summary>
            [ExporterHeader("待办链接")]
            public string LinkUrl { get; set; }

            /// <summary>
            /// 模版类型名
            /// </summary>
            [ExporterHeader("模版类型")]
            public string TemplateTypeName { get; set; }
        }

        /// <summary>
        /// 历史数据显示Dto
        /// </summary>
        public class PerformHistoryDto
        {
            public string Template { get; set; }
            public string FormTitle { get; set; }
            public string SubjectId { get; set; }
            public string SubjectName { get; set; }
            public string ApplyJob { get; set; }
            public string OrgName { get; set; }
            public Sections FormData { get; set; }
            public List<PerformStepEntity> Steps { get; set; }

        }


        public class PerformHistoryExportStringDto
        {
            public string requestdata { get; set; }
        }

        /// <summary>
        /// 历史数据显示Dto
        /// </summary>
        public class PerformHistoryExportDto
        {
            public FormData formData { get; set; }
            public ColumnDto Columns { get; set; }

            public BusinessDataDto businessData { get; set; }
        }

        public class FormData
        {
            public string Template { get; set; }
            public string FormTitle { get; set; }
            public string SubjectId { get; set; }
            public string SubjectName { get; set; }
            public string ApplyerJob { get; set; }
            public string OrgName { get; set; }
            public string LastLevel { get; set; }
        }

        public class BusinessDataDto
        {
            public string Record1 { get; set; }

            public List<JObject> SecondData { get; set; }
            public List<JObject> ThirdData { get; set; }
            public List<JObject> ThirdData1 { get; set; }
            public List<JObject> ThirdData2 { get; set; }
            public List<JObject> FourData { get; set; }
            public List<JObject> FiveData { get; set; }
            public List<JObject> TotalData { get; set; }
        }

        public class ColumnDto
        {
            public List<ColumnCellDto> SecondColumn { get; set; }
            public List<ColumnCellDto> ThirdColumn { get; set; }
            public List<ColumnCellDto> ThirdColumn1 { get; set; }
            public List<ColumnCellDto> ThirdColumn2 { get; set; }
            public List<ColumnCellDto> FourColumn { get; set; }
            public List<ColumnCellDto> FiveColumn { get; set; }

            public List<ColumnCellDto> TotalColumn { get; set; }
        }

        public class ColumnCellDto
        {
            public string field { get; set; }
            public string title { get; set; }
        }
    }
}
